package com.firebird.app.kotlin.stock

import android.app.Application
import android.content.Context
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.FormatStrategy
import com.orhanobut.logger.Logger
import com.orhanobut.logger.PrettyFormatStrategy


class App : Application() {
    override fun onCreate() {
        super.onCreate()
        context = this.applicationContext
        //初始化Logger
        val formatStrategy: FormatStrategy = PrettyFormatStrategy.newBuilder()
                .showThreadInfo(false) //是否选择显示线程信息，默认为true
                .methodCount(1) //方法数显示多少行，默认2行
                .methodOffset(7) //隐藏方法内部调用到偏移量，默认5
                .tag("tag") //自定义TAG全部标签，默认PRETTY_LOGGER
                .build()
        Logger.addLogAdapter(AndroidLogAdapter(formatStrategy))
    }

    companion object {
        var context: Context? = null
    }
}